<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<c:choose>
	<c:when test="${empty fornecedores}">
	    <div class="alert alert-info">
	    	<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
	    	<h3><fmt:message key="BUNDLE_WARNING"/></h3> <fmt:message key="BUNDLE_EMPTY_SUPPLIERS"/>
	    </div>
	</c:when>
	<c:otherwise>
		<table class="table table-bordered table-hover">
			<caption><h3> <fmt:message key="BUNDLE_SUPPLIERS"/> </h3></caption>
			<thead>
   				<tr>
    				<th><fmt:message key="BUNDLE_NOME"/></th>
    				<th><fmt:message key="BUNDLE_MAIN_PHONE"/></th>
    				<th><fmt:message key="BUNDLE_EMAIL"/></th>
    				<th colspan="2"><fmt:message key="BUNDLE_ACTIONS"/></th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${fornecedores}" var="fornecedor">
					<tr>
						<td>${fornecedor.nome}</td>
						<td>${fornecedor.telefone1}</td>
						<td>${fornecedor.email}</td>
						<td>
							<a class="btn btn-small btn-primary" href="${pageContext.request.contextPath}/fornecedor/${fornecedor.id}/edit">
								<i class="icon-edit icon-white"></i> <fmt:message key="BUNDLE_EDIT"/>
							</a>
						</td>
						<td>
							<a class="btn btn-small btn-primary" href="${pageContext.request.contextPath}/fornecedor/${fornecedor.id}/show">
								<i class="icon-edit icon-white"></i> <fmt:message key="BUNDLE_SHOW"/>
							</a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</c:otherwise>
</c:choose>